<%@page import="com.cys.bean.DripData"%>
<%@page import="com.cys.bean.WaterMix"%>
<%@page import="com.cys.bean.WaterQCData"%>
<%@page import="com.cys.bean.CurtainData"%>
<%@page import="com.cys.bean.Level"%>
<%@page import="com.cys.bean.WaterData"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@page import="java.util.List"%>
<%@page import="com.cys.bean.WeatherStations"%>
<%@page import="com.cys.bean.SoilData"%>
<%@page import="com.cys.bean.AirData"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>实时数据</title>
<link rel="stylesheet" type="text/css" href="css/css.css" />
<script src="js/jquery.min.js" type="text/javascript"></script>
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/stylesheet.css" rel="stylesheet">
<link href="css/index.css" rel="stylesheet">



<!-- Le fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="img/apple-touch-icon-144-precomposed.html">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="img/apple-touch-icon-114-precomposed.html">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="img/apple-touch-icon-72-precomposed.html">
<link rel="apple-touch-icon-precomposed"
	href="img/apple-touch-icon-57-precomposed.html">

<!--主要样式-->
<link rel="stylesheet" type="text/css" href="css/style.css" />

<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
	function setParamer() {
		document.getElementById('probar').width = "20px"
	}

	function processerbar(time) {
		document.getElementById('probar').style.display = "block";
		$("#line").each(function(i, item) {
			var a = parseInt($(item).attr("w"));
			$(item).animate({
				width : a + "%"
			}, time);
		});
		var si = window.setInterval(function() {
			a = $("#line").width();
			b = (a / 200 * 100).toFixed(0);
			document.getElementById('percent').innerHTML = b + "%";
			document.getElementById('percent').style.left = a - 12 + "px";
			document.getElementById('msg').innerHTML = "请稍等....";
			if (document.getElementById('percent').innerHTML == "100%") {
				clearInterval(si);
				document.getElementById('msg').innerHTML = "&nbsp;&nbsp;完成";
			}
		}, 70);
	};
</script>
<style type="text/css">
.tree {
	width: 300px;
	height: 500px;
	background-color: rgb(238, 243, 247);
	float: left;
	overflow-y: scroll;
	padding: 0px;
	border: 0px;
	border-radius: 0px;
}

.btn1 {;
	color: #FFF;
	position: absolute;
	left: 80%;
	top: 85px
}
</style>
</head>

<body style="overflow-x: hidden; overflow-y: scroll; width: 85%;">
	<div>
		<div class="daohanglink" style="">
			<span class="daohang"></span> <span>首页</span><span>></span> <span>实时数据</span>

		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>气象站数据</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="WeatherStationsServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>气象站编号</th>
					<th>更新日期</th>
					<th>风速</th>
					<th>风向</th>
					<th>光照强度</th>
					<th>温度</th>
					<th>湿度</th>
				</tr>
				<%
					// 获取图书信息集合
					List<WeatherStations> list = (List<WeatherStations>) request.getAttribute("list");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (list == null || list.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (WeatherStations wsData : list) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=wsData.getDev_weather_station()%></td>
					<td><%=wsData.getData_time()%></td>
					<td><%=wsData.getWind_speed()%></td>
					<td><%=wsData.getWind_origent()%></td>
					<td><%=wsData.getRightess()%></td>
					<td><%=wsData.getTemperlature()%></td>
					<td><%=wsData.getWetness()%></td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>

		<div; width: 125%">
			<div class="well-header">
				<h5>土壤检测器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="SoilDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>土壤检测器编号</th>
					<th>更新日期</th>
					<th>土壤水分</th>
					<th>土壤盐分</th>
				</tr>
				<%
					// 获取图书信息集合
					List<SoilData> slist = (List<SoilData>) request.getAttribute("slist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (slist == null || slist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (SoilData soilData : slist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=soilData.getDev_soil_monitor()%></td>
					<td><%=soilData.getData_time()%></td>
					<td><%=soilData.getOil_wetness()%></td>
					<td><%=soilData.getSoil_salinity()%></td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>空气检测器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="AirDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>空气检测器编号</th>
					<th>更新日期</th>
					<th>光照强度</th>
					<th>温度</th>
					<th>湿度</th>
				</tr>
				<%
					// 获取图书信息集合
					List<AirData> alist = (List<AirData>) request.getAttribute("alist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (alist == null || alist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (AirData airData : alist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=airData.getDev_air_monitor()%></td>
					<td><%=airData.getData_time()%></td>
					<td><%=airData.getBrightness()%></td>
					<td><%=airData.getTemperlature()%></td>
					<td><%=airData.getWetness()%></td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>水质检测器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="WaterDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>水质检测器编号</th>
					<th>更新日期</th>
					<th>pH</th>
				</tr>
				<%
					// 获取图书信息集合
					List<WaterData> wlist = (List<WaterData>) request.getAttribute("wlist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (wlist == null || wlist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (WaterData waterData : wlist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=waterData.getDev_water_monitor()%></td>
					<td><%=waterData.getData_time()%></td>
					<td><%=waterData.getph()%></td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>水位检测器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="LevelServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>水位检测器编号</th>
					<th>更新日期</th>
					<th>水位</th>
				</tr>
				<%
					// 获取图书信息集合
					List<Level> llist = (List<Level>) request.getAttribute("llist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (llist == null || llist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (Level level : llist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=level.getDev_waterlevel_monitor()%></td>
					<td><%=level.getData_time()%></td>
					<td><%=level.getLevel()%></td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>卷帘机数据</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="CurtainDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>卷帘机编号</th>
					<th>更新日期</th>
					<th>位置</th>
					<th>状态</th>
					<th>模式</th>
					<th>光照警告</th>
					<th>位置警告</th>
					<th>开启警告</th>
					<th>停止警告</th>
				</tr>
				<%
					// 获取图书信息集合
					List<CurtainData> clist = (List<CurtainData>) request.getAttribute("clist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (clist == null || clist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (CurtainData curtainData : clist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=curtainData.getDev_curtain_controlor()%></td>
					<td><%=curtainData.getData_time()%></td>
					<td><%=curtainData.getPosition()%></td>
					<td><%=curtainData.getState()%></td>
					<td>
						<%
							if (curtainData.getMode().equals(0))
										out.print("自动");
									else
										out.print("手动");
						%>
					</td>
					<td>
						<%
							if (curtainData.getAlarm_brightness() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (curtainData.getAlarm_positon() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (curtainData.getAlarm_startup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (curtainData.getAlarm_stop() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>水质控制器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="WaterQCDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>水质控制器编号</th>
					<th>更新日期</th>
					<th>水位</th>
					<th>状态</th>
					<th>模式</th>
					<th>水位低警告</th>
					<th>水位高警告</th>
					<th>启动鼓掌</th>
					<th>停止故障</th>
				</tr>
				<%
					// 获取图书信息集合
					List<WaterQCData> wqlist = (List<WaterQCData>) request.getAttribute("wqlist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (wqlist == null || wqlist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (WaterQCData waterQCData : wqlist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=waterQCData.getDev_water_controlor()%></td>
					<td><%=waterQCData.getData_time()%></td>
					<td><%=waterQCData.getLevel()%></td>
					<td>
						<%
							if (waterQCData.getState() == 0)
										out.print("正常");
									else
										out.print("异常");
						%>
					</td>
					<td>
						<%
							if (waterQCData.getMode() == 0)
										out.print("自动");
									else
										out.print("手动");
						%>
					</td>
					<td>
						<%
							if (waterQCData.getAlarm_leveldown() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterQCData.getAlarm_levelup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterQCData.getAlarm_startup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterQCData.getAlarm_stop() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>水处理控制器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="WaterMixServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>水处理器编号</th>
					<th>更新日期</th>
					<th>液位</th>
					<th>营养液位</th>
					<th>pH值</th>
					<th>状态</th>
					<th>模式</th>
					<th>进水状态</th>
					<th>灌溉状态</th>
					<th>营养液低</th>
					<th>营养液高</th>
					<th>水泵启动故障</th>
					<th>水泵停止故障</th>
					<th>搅拌机启动故障</th>
					<th>水泵停止故障</th>
				</tr>
				<%
					// 获取图书信息集合
					List<WaterMix> wmlist = (List<WaterMix>) request.getAttribute("wmlist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (wmlist == null || wmlist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (WaterMix waterMix : wmlist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=waterMix.getDev_watermix_controlor()%></td>
					<td><%=waterMix.getData_time()%></td>
					<td><%=waterMix.getLevel()%></td>
					<td><%=waterMix.getNeutralize_level()%></td>
					<td><%=waterMix.getPh()%></td>
					<td>
						<%
							if (waterMix.getState() == 0)
										out.print("正常");
									else
										out.print("异常");
						%>
					</td>
					<td>
						<%
							if (waterMix.getMode() == 0)
										out.print("自动");
									else
										out.print("手动");
						%>
					</td>
					<td>
						<%
							if (waterMix.getState_inwater() == 0)
										out.print("停止");
									else
										out.print("进水中");
						%>
					</td>
					<td>
						<%
							if (waterMix.getState_drip() == 0)
										out.print("停止");
									else
										out.print("正在滴灌");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_neutralizewater_low() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_neutralizewater_high() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_pump_startup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_pump_stop() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_mix_startup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (waterMix.getAlarm_mix_stop() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>
		<div; width: 125%">
			<div class="well-header">
				<h5>滴灌控制器</h5>
				<a class="btn1" style="position: relative; top: 5px"
					href="DripDataServlet">查看</a>
			</div>
			<table
				class="table table-striped table-bordered table-hover datatable">
				<tr>
					<th>滴灌编号</th>
					<th>更新日期</th>
					<th>液面</th>
					<th>土壤湿度</th>
					<th>pH值</th>
					<th>状态</th>
					<th>模式</th>
					<th>进水状态</th>
					<th>液面混合状态</th>
					<th>土壤湿度高</th>
					<th>水pH</th>
					<th>滴灌启动故障</th>
					<th>滴灌停止故障</th>
				</tr>
				<%
					// 获取图书信息集合
					List<DripData> dlist = (List<DripData>) request.getAttribute("dlist");
					//List<WeatherStations> list =(List<WeatherStations>)request.getAttribute("list");	
					// 判断集合是否有效
					if (dlist == null || dlist.size() < 1) {
						out.print("没有数据！");
					} else {
						// 遍历图书集合中的数据
						for (DripData dripData : dlist) {
				%>
				<tr align="center" bgcolor="white">
					<td><%=dripData.getDev_drip_controlor()%></td>
					<td><%=dripData.getData_time()%></td>
					<td><%=dripData.getLevel()%></td>
					<td><%=dripData.getSoil_wetness()%></td>
					<td><%=dripData.getWater_ph()%></td>
					<td>
						<%
							if (dripData.getState() == 0)
										out.print("正常");
									else
										out.print("异常");
						%>
					</td>
					<td>
						<%
							if (dripData.getMode() == 0)
										out.print("自动");
									else
										out.print("手动");
						%>
					</td>
					<td>
						<%
							if (dripData.getState_waterin() == 0)
										out.print("停止");
									else
										out.print("进水中");
						%>
					</td>
					<td>
						<%
							if (dripData.getState_watermix() == 0)
										out.print("停止");
									else
										out.print("运行中");
						%>
					</td>
					<td>
						<%
							if (dripData.getSoil_wetness() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (dripData.getAlarm_water_ph() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (dripData.getAlarm_drip_startup() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
					<td>
						<%
							if (dripData.getAlarm_drip_stop() == 0)
										out.print("无警告");
									else
										out.print("警告");
						%>
					</td>
				</tr>
				<%
					}
					}
				%>

			</table>
		</div>

	</div>


	<!-- Le javascript
    ================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script src="js/jquery-1.10.2.js"></script>
	<script src="js/jquery-ui-1.10.3.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/flatpoint_core.js"></script>
</body>
</html>
